<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>增加管理员</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/layui.css" media="all">
    <link id="layuicss-layer" rel="stylesheet" href="__PUBLIC__/layuiadmin/layui/css/modules/layer/default/layer.css?v=3.1.1" media="all"></head>
<body layadmin-themealias="default">

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="form_role" style="padding: 20px 30px 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">用户ID</label>
        <div class="layui-input-inline">
            <input type="number" name="gameid" readonly="readonly" value="{$id}" autocomplete="off" class="layui-input">
            <input type="hidden" name="oldgold50" value="{$gold50}">
            <input type="hidden" name="oldgold100" value="{$gold100}">
            <input type="hidden" name="oldgold200" value="{$gold200}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">50银币卡</label>
        <div class="layui-input-inline">
            <input type="number" name="1001" lay-verify="required" required   placeholder="请输入50银币卡增加数量" value="0" autocomplete="off" min="0" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">持有数量：{$gold50}</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">100银币卡</label>
        <div class="layui-input-inline">
            <input type="number" name="1002" lay-verify="required"  min="0" placeholder="请输入100银币卡增加数量" value="0" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">持有数量：{$gold100}</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">200银币卡</label>
        <div class="layui-input-inline">
            <input type="number" name="1003" lay-verify="required"  min="0" placeholder="请输入200银币卡增加数量" value="0" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">持有数量：{$gold200}</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银币总量</label>
        <div class="layui-input-inline">
            <input type="number" name="d" id="n" readonly="readonly" value="0"  autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit="" lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</div>

<script src="__PUBLIC__/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '__PUBLIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function(){
        var $ = layui.$
            ,form = layui.form ;
        var a=b=c=0;
        $('.layui-input').on('change',function () {
            var s= $(this).attr('name');
            var v = $(this).val();
            //var n = $('#n').val();
            var d = 0;
            switch (s) {
                case '1001':
                    a= v;
                    break;
                case  '1002':
                    b =v;
                    break;
                case  '1003':
                    c = v;
                    break;
            }
            d = (a*50)+(b*100)+(c*200);// parseInt(n)+ parseInt(d);
            $('#n').val(d);
        });
    })
</script>
</body>
</html>